package com.wlyuan.index.domain.source.valueobj;

import com.wlyuan.core.marker.INamed;
import com.wlyuan.core.marker.NamedMap;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

@Getter
@AllArgsConstructor
public enum CarrierType implements INamed<Integer> {
    OFFLINE(0, "线下"),
    ONLINE(1, "线上"),
    MYSELF(2, "自己");
    private final Integer value;
    private final String name;

    private static final Map<Integer, CarrierType> MAP = new NamedMap<>(CarrierType.class);

    public static CarrierType valueOf(Integer value) {
        return MAP.get(value);
    }
}